Extended Initiality for Typed Abstract Syntax

نویسنده

  • Benedikt Ahrens
چکیده

Initial Semantics aims at interpreting the syntax associated to a signature as the initial object of some category of “models”, yielding induction and recursion principles for abstract syntax. Zsidó [Zsi10, Chap. 6] proves an initiality result for simply–typed syntax: given a signature S, the abstract syntax associated to S constitutes the initial object in a category of models of S in monads. However, the iteration principle her theorem provides only accounts for translations between two languages over a fixed set of object types. We generalize Zsidó’s notion of model such that object types may vary, yielding a larger category, while preserving initiality of the syntax therein. Thus we obtain an extended initiality theorem for typed abstract syntax, in which translations between terms over different types can be specified via the associated category–theoretic iteration operator as an initial morphism. Our definitions ensure that translations specified via initiality are type–safe, i.e. compatible with the typing in the source and target language in the obvious sense. Our main example is given via the propositions–as–types paradigm: we specify propositions and inference rules of classical and intuitionistic propositional logics through their respective typed signatures. Afterwards we use the category–theoretic iteration operator to specify a double negation translation from the former to the latter. A second example is given by the signature of PCF. For this particular case, we formalize the theorem in the proof assistant Coq. Afterwards we specify, via the category–theoretic iteration operator, translations from PCF to the untyped lambda calculus.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Initial Semantics for higher-order typed syntax

We present an initial semantics result for typed higher-order syntax based on monads and modules over monads. The notion of module generalizes the substitution structure of monads. For a simply typed binding signature S we define a representation of S to be a monad equipped with a morphism of modules for each of its arities. The monad of abstract syntax of S then is the initial object in the ca...

متن کامل

Benedikt Ahrens: Initiality for Typed Syntax and Semantics

We give an algebraic characterization of the syntax and semantics of a class of simply–typed languages, such as the language PCF: we characterize simply–typed binding syntax equipped with reduction rules via a universal property, namely as the initial object of some category. For this purpose, we employ techniques developed in two previous works: in [2], we model syntactic translations between ...

متن کامل

Initiality for Typed Syntax and Semantics

We give an algebraic characterization of the syntax and semantics of a class of simply–typed languages, such as the language PCF: we characterize simply–typed binding syntax equipped with reduction rules via a universal property, namely as the initial object of some category. For this purpose, we employ techniques developed in two previous works: in [2], we model syntactic translations between ...

متن کامل

Phantom Types

Phantom types are data types with type constraints associated with different cases. Examples of phantom types include typed type representations and typed higher-order abstract syntax trees. These types can be used to support typed generic functions, dynamic typing, and staged compilation in higher-order, statically typed languages such as Haskell or Standard ML. In our system, type constraints...

متن کامل

Modules over relative monads for syntax and semantics

The goal of this article is to give an algebraic characterisation of the abstract syntax of functional programming languages, equipped with reduction rules. We introduce a notion of 2–signature: such a signature specifies not only the terms of a language, but also reduction rules on those terms. To any 2–signature S we associate a category of “models” of S, and we prove that this category has a...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Logical Methods in Computer Science

دوره 8  شماره 

صفحات  -

تاریخ انتشار 2011